<?PHP
$con=mysqli_connect("localhost","root","fanghao","my_db");
if (mysqli_connect_errno()){
	echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$rs = mysqli_query($con,"SELECT * FROM users");
$result = array();
while($row = mysqli_fetch_object($rs)){
	array_push($result, $row);
}
mysqli_close($con);
echo json_encode($result);
?>